package com.example.resourceofDengJL;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.env.Environment;

@SpringBootApplication
public class RestDengJLApplication implements CommandLineRunner {

    private final Environment env;

    public RestDengJLApplication(Environment env) {
        this.env = env;
    }

    public static void main(String[] args) {
        SpringApplication.run(RestDengJLApplication.class, args);
    }

    @Override
    public void run(String... args) {
        String port = env.getProperty("server.port", "8080"); // 从配置获取端口，默认8080
        System.out.println("\n===== 服务端已启动 =====");
//        System.out.println("GET 所有学生信息: http://localhost:" + port + "/students");
//        System.out.println("POST 添加学生信息: http://localhost:" + port + "/students");
//        System.out.println("GET 单个学生信息: http://localhost:" + port + "/students/1");
        System.out.println("请运行客户端");
    }
}